package com.zd.zdMerchant.common.utils;

import sun.misc.BASE64Encoder;

import java.security.MessageDigest;

public class EncryptUtils {

    public static  String encryptMD5(String str){
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            BASE64Encoder base64Encoder = new BASE64Encoder();
            return base64Encoder.encode(md5.digest(str.getBytes("utf-8")));
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}
